<template>
	<view style="padding-top: 100rpx;">
		<view class="text-outer" v-for=" (item ,index) in list">
			 <image :src="user.head_img" mode="" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;"></image>
			<view> {{filterTime(item.time)}}</view>
			<view>用户 {{item.content}}了</view>
     
		</view>
	</view>
</template>

<script>
	import GoEasy from '@/lib/goeasy-2.4.6.min.js';
	export default {
		data() {
			return {
				list: [],
				user:'',
				allArr:[],//统计所有评论收藏
			}
		},
		filters: {
			showDate(value) {
				let date = new Date(value * 1000);
				var time = this.formatDate2(date, 'yyyy-MM-dd hh:mm:ss');
				return time
			}
		},
		onLoad(option) {
		 this.list=JSON.parse(option.arr);
		 this.user=uni.getStorageSync('user')
		},
		onShow() {
			
		},
		methods: {
			user() {
				return this.$store.state.user;
			},
			//转换时间
		filterTime(time) {
		var date = new Date(+time),
		    Y = date.getFullYear() + '-',
		    M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-',
		    D = date.getDate() + ' ',
		    h = date.getHours() + ':',
		    m = date.getMinutes() + ':',
		    s = date.getSeconds()
		    return Y + M + D   // '2022-05-20'
		  },

			 padLeftZero(str) {
				return ('00' + str).substr(str.length);
			},


		}

	}
</script>

<style>
	.text-outer {
		position: relative;
		width: 100%;
		display: flex;
		align-items: center;
		 /* justify-content: space-between; */
		line-height: 120rpx;
		height: 120rpx;
		padding-left: 30rpx;
		padding-right: 30rpx;
		border-bottom: 1px solid #333;
		box-sizing: border-box;
	}
	.text-count{
		position: absolute;
		z-index: 100;
		left: 10%;
		top: 10%;
		width: 30rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		height: 30rpx;
		border-radius: 50%;
		background-color: red;
		color: #fff;
	}
</style>
